
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>游戏首页</title>
<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
  
  <script language="javascript">
    //去掉空格
    function trim(str) {
      return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, '');
    }
    
    
    function  changeImg(){
        document.getElementById("selectedForm").submit();
      }
    
    
    function  form_submit(){
        var id=document.getElementById("id").value;
        var picurl;
        if(document.selectedhidden_frame.picurl!=null){
          picurl=document.selectedhidden_frame.picurl.src;
        }
      var order=document.getElementById("order").value;
      var status=document.getElementById("status").value;
      var info=document.getElementById("info").value;
      var apkname=document.getElementById("apkname").value;
      
      if(trim(apkname)==''){
        alert("请填写APK包名！");
        return;
      }
      if(trim(order)==''){
        alert("请正确填写权重！");
        return;
      }
      if(trim(picurl)==''){
        alert("请上传图片！");
        return;
      }
      
      $.ajax({
      url : "gcenter_adv!save.action",
      data :{
        id : id ,
        picurl : picurl,
        order:order,
        status:status,
        info:info,
        apkname:apkname
      },
      dataType: "json",
      type:"get",
      success:function(data){
        alert(data.message);
      },
      error:function(XMLHttpRequest, textStatus, errorThrown){
      }
        })
      return ;
      }
      
      $(function(){
        $("#result>tbody>tr>td:nth-child(1)").css({"background-color":"#f3f3f3","font-weight":"bold"});
        $("#result>tbody>tr>td:nth-child(2)").css({"text-align":"left","padding-left":"5px"});
      });
    
  </script>
  
  <style type="text/css">



body {
     font-family:Arial, Helvetica, sans-serif;
     font-size:13px;
   }

h1 {
   font-size:18px;
   font-weight:bold; 
   }

#navigation
  {
  font-family:Arial, Helvetica, sans-serif;
    font-size:13px;
  width:80%;
  }
#result
  {
  font-family:Arial, Helvetica, sans-serif;
  font-size:13px;
  width:95%;
  border-collapse:collapse;
  }

#result td, #result th 
  {
  border:1px solid black;
  text-align:center;
  vertical-align:center;
  padding-top:2px;
  padding-bottom:2px;
  line-height:25px;
  height: 40px;
  }
#result td a{color:#000;text-decoration:none;}
#result td a:hover{text-decoration:underline}
#result th 
  {
  background-color:#8DB4E2;
  color:black;
  }

#result tr.alt td 
  {
  color:#000000;
  background-color:#E8F6FF;
  }

ul.button 
  {
  border-bottom: 1px solid #e7e7e7;
  float: left;
  clear: left;
  margin:0px;
  padding:0px;
  list-style:none;
  }

ul.button li 
  {
  float: left;
  margin:0px;
  padding:0px;
  list-style:none;
  }

ul.button li a 
  {
  float: left;
  text-decoration: none;
  color: dimgray;
  padding: 4px 15px 0 0;
  margin-right: 8px;
  font: 900 13px "Arial", Helvetica, sans-serif;
  }

ul.button li a span 
  {
  float: left;
  padding-right: 10px;
  display: block;
  margin-top: -4px;
  height: 24px;
  }

ul.button li a:hover 
  {
  color: #0d5f83;
  background: url(images/blue.png) ;
  }

ul.button li a:hover span 
  {
  background: url(images/blue.png) ; 
  }

.pag{padding:10px 0px 0px 0px;}
.pag ul{margin-right:70px;padding:0;text-align: right;}
.pag li{list-style: none;display: inline;}
.pag li.ch{text-align:center;vertical-align: middle;color:#0055A1;font-weight:bold;padding:0px;margin:0px;width:25px;height:20px;line-height:20px;}


.pag a{padding:2px 6px 0px 6px;text-decoration: none;color: #6F6F6F;text-align:center;}
.pag a:hover{color: #000000;text-decoration: none;}
.currentpage{font-weight: bold;padding:2px 6px 0px 6px;color:#000;margin-right: 5px; text-align:center;}

p.sum {color:firebrick}
p.note {color:forestgreen}

#submitBtn{
  margin-left:540px;
}

</style>
</head>
<body>
<div class="title_l" style="margin-top:10px;margin-left:30px;font-weight:bold;font-size:16px;">游戏首页--Banner</div>
 
  <div style="margin-top:20px;margin-left:30px;">
   <div>
  
  <input type="hidden" name="id" id="id" value="">
    <table id="result">
      <tr>
        <td>APK ：</td> <td><input name="apkname"  id="apkname"/></td> 
      </tr>
      <tr>  
        <td width="10%" align="right"> 图片： </td>
            <td align="left">&nbsp;&nbsp;
              <iframe frameborder="0" scrolling="no" style='width:235px; height:136px' name="selectedhidden_frame" id="selectedhidden_frame" src=""> </iframe>
              <form  name="selectedForm" id="selectedForm" action="" enctype='multipart/form-data' method='post' target='selectedhidden_frame'>
          <input type='file' name="selectedImg" id="selectedImg" onchange="changeImg()" />
            </form> 
             </td>
        </tr>
      <tr>
        <td>权重：</td> <td><input  name="order" id="order"/> （0~99）越大越靠前</td> 
      </tr> 
      <tr>
        <td>状态：</td> 
        <td>
          <select name="status" id="status"/>  
            <option value="1">发布 </option>
            <option value="0">不发布 </option>
          </select>  （需要更新缓存 线上才会生效）
        </td>
      </tr>
      <tr>
        <td>描述：</td> <td><textarea  name="info" id="info" rows="3" cols="80"> </textarea></td> 
      </tr>
      <tr>
        <td>&nbsp;</td> <td><input id="submitBtn" type="button"  value="提交"  onclick="form_submit();"/></td> 
      </tr>
    </table>
    </div>
</div>
</body>
</html>
